import type { Rule } from 'antd/lib/form';

export enum ServiceProxy {
  DefaultPrefix = '/blog_back',
}

export const DEFAULT_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';

// 登录需要使用常量
export const LOGIN_PATH = '/verify/login';
// 不需要登录的路径
export const NO_NEED_LOGIN_PATHS = ['/verify'];
export const LOGIN_FROM_TAG = 'LOGIN_FROM';

export const USER_CACHE_KEY = 'user-cache-key';
export const USER_CACHE_KEY_Time = 'user-cache-key-time';

// 最多两个，当个最大5M
export const UPLOAD_IMAGE_PATH = `${ServiceProxy?.DefaultPrefix}/upload/image`;

export const IMAGE_FALL_BACK =
  '';

// 默认的表单必填rule
export const DEFAULT_REQUIRED_RULE: Rule[] = [
  {
    required: true,
  },
];

// 弹窗组件的title展示map
export const MODAL_TITLE_MAP = {
  add: '添加',
  view: '查看',
  edit: '编辑',
};

// 全局配置
export const GLOBAL_CONFIG = {
  forceGetLoginInfo: false,
};
